import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'
import * as packageConfig from '../package.json'

export const generateDocument = (app) => {
  const options = new DocumentBuilder().setTitle('vue-admin-api').setDescription(packageConfig.description).setVersion(packageConfig.version).build()

  const document = SwaggerModule.createDocument(app, options)

  SwaggerModule.setup('/api/doc', app, document)
}
